package net.ymate.wechat.model;

import net.ymate.platform.core.beans.annotation.PropertyState;
import net.ymate.platform.persistence.IShardingable;
import net.ymate.platform.persistence.annotation.Default;
import net.ymate.platform.persistence.annotation.Entity;
import net.ymate.platform.persistence.annotation.Id;
import net.ymate.platform.persistence.annotation.Property;
import net.ymate.platform.persistence.jdbc.IConnectionHolder;
import net.ymate.platform.persistence.jdbc.support.BaseEntity;

/**
 * WechatMessage generated By EntityGenerator on 2017/08/18 上午 09:39:10
 *
 * @author YMP
 * @version 1.0
 */
@Entity("wechat_message")
public class WechatMessage extends BaseEntity<WechatMessage, java.lang.String> {

    private static final long serialVersionUID = 1L;

    @Id
    @Property(name = "id", nullable = false, length = 32)
    @PropertyState(propertyName = "id")
    private java.lang.String id;

    @Property(name = "from_uid", nullable = false, length = 32)
    @PropertyState(propertyName = "from_uid")
    private java.lang.String fromUid;

    @Property(name = "to_uid", nullable = false, length = 32)
    @PropertyState(propertyName = "to_uid")
    private java.lang.String toUid;

    @Property(name = "content", nullable = false, length = 4194303)
    @PropertyState(propertyName = "content")
    private java.lang.String content;

    @Property(name = "is_star", unsigned = true, length = 1)
    @Default("0")
    @PropertyState(propertyName = "is_star")
    private java.lang.Integer isStar;

    @Property(name = "is_replied", unsigned = true, length = 1)
    @Default("0")
    @PropertyState(propertyName = "is_replied")
    private java.lang.Integer isReplied;

    @Property(name = "is_autoreply", unsigned = true, length = 1)
    @Default("0")
    @PropertyState(propertyName = "is_autoreply")
    private java.lang.Integer isAutoreply;

    @Property(name = "is_read", unsigned = true, length = 1)
    @Default("0")
    @PropertyState(propertyName = "is_read")
    private java.lang.Integer isRead;

    @Property(name = "is_deleted", unsigned = true, length = 1)
    @Default("0")
    @PropertyState(propertyName = "is_deleted")
    private java.lang.Integer isDeleted;

    @Property(name = "session_flag", length = 32)
    @PropertyState(propertyName = "session_flag")
    private java.lang.String sessionFlag;

    @Property(name = "type", unsigned = true, length = 2)
    @Default("0")
    @PropertyState(propertyName = "type")
    private java.lang.Integer type;

    @Property(name = "status", unsigned = true, length = 2)
    @Default("0")
    @PropertyState(propertyName = "status")
    private java.lang.Integer status;

    @Property(name = "idx_status", unsigned = true, length = 2)
    @Default("0")
    @PropertyState(propertyName = "idx_status")
    private java.lang.Integer idxStatus;

    @Property(name = "create_time", nullable = false, length = 13)
    @PropertyState(propertyName = "create_time")
    private java.lang.Long createTime;

    /**
     * 构造器
     */
    public WechatMessage() {
    }

    /**
     * 构造器
     *
     * @param id
     * @param fromUid
     * @param toUid
     * @param content
     * @param createTime
     */
    public WechatMessage(java.lang.String id, java.lang.String fromUid, java.lang.String toUid, java.lang.String content, java.lang.Long createTime) {
        this.id = id;
        this.fromUid = fromUid;
        this.toUid = toUid;
        this.content = content;
        this.createTime = createTime;
    }

    /**
     * 构造器
     *
     * @param id
     * @param fromUid
     * @param toUid
     * @param content
     * @param isStar
     * @param isReplied
     * @param isAutoreply
     * @param isRead
     * @param isDeleted
     * @param sessionFlag
     * @param type
     * @param status
     * @param idxStatus
     * @param createTime
     */
    public WechatMessage(java.lang.String id, java.lang.String fromUid, java.lang.String toUid, java.lang.String content, java.lang.Integer isStar, java.lang.Integer isReplied, java.lang.Integer isAutoreply, java.lang.Integer isRead, java.lang.Integer isDeleted, java.lang.String sessionFlag, java.lang.Integer type, java.lang.Integer status, java.lang.Integer idxStatus, java.lang.Long createTime) {
        this.id = id;
        this.fromUid = fromUid;
        this.toUid = toUid;
        this.content = content;
        this.isStar = isStar;
        this.isReplied = isReplied;
        this.isAutoreply = isAutoreply;
        this.isRead = isRead;
        this.isDeleted = isDeleted;
        this.sessionFlag = sessionFlag;
        this.type = type;
        this.status = status;
        this.idxStatus = idxStatus;
        this.createTime = createTime;
    }

    @Override
    public java.lang.String getId() {
        return id;
    }

    @Override
    public void setId(java.lang.String id) {
        this.id = id;
    }


    /**
     * @return the fromUid
     */
    public java.lang.String getFromUid() {
        return fromUid;
    }

    /**
     * @param fromUid the fromUid to set
     */
    public void setFromUid(java.lang.String fromUid) {
        this.fromUid = fromUid;
    }

    /**
     * @return the toUid
     */
    public java.lang.String getToUid() {
        return toUid;
    }

    /**
     * @param toUid the toUid to set
     */
    public void setToUid(java.lang.String toUid) {
        this.toUid = toUid;
    }

    /**
     * @return the content
     */
    public java.lang.String getContent() {
        return content;
    }

    /**
     * @param content the content to set
     */
    public void setContent(java.lang.String content) {
        this.content = content;
    }

    /**
     * @return the isStar
     */
    public java.lang.Integer getIsStar() {
        return isStar;
    }

    /**
     * @param isStar the isStar to set
     */
    public void setIsStar(java.lang.Integer isStar) {
        this.isStar = isStar;
    }

    /**
     * @return the isReplied
     */
    public java.lang.Integer getIsReplied() {
        return isReplied;
    }

    /**
     * @param isReplied the isReplied to set
     */
    public void setIsReplied(java.lang.Integer isReplied) {
        this.isReplied = isReplied;
    }

    /**
     * @return the isAutoreply
     */
    public java.lang.Integer getIsAutoreply() {
        return isAutoreply;
    }

    /**
     * @param isAutoreply the isAutoreply to set
     */
    public void setIsAutoreply(java.lang.Integer isAutoreply) {
        this.isAutoreply = isAutoreply;
    }

    /**
     * @return the isRead
     */
    public java.lang.Integer getIsRead() {
        return isRead;
    }

    /**
     * @param isRead the isRead to set
     */
    public void setIsRead(java.lang.Integer isRead) {
        this.isRead = isRead;
    }

    /**
     * @return the isDeleted
     */
    public java.lang.Integer getIsDeleted() {
        return isDeleted;
    }

    /**
     * @param isDeleted the isDeleted to set
     */
    public void setIsDeleted(java.lang.Integer isDeleted) {
        this.isDeleted = isDeleted;
    }

    /**
     * @return the sessionFlag
     */
    public java.lang.String getSessionFlag() {
        return sessionFlag;
    }

    /**
     * @param sessionFlag the sessionFlag to set
     */
    public void setSessionFlag(java.lang.String sessionFlag) {
        this.sessionFlag = sessionFlag;
    }

    /**
     * @return the type
     */
    public java.lang.Integer getType() {
        return type;
    }

    /**
     * @param type the type to set
     */
    public void setType(java.lang.Integer type) {
        this.type = type;
    }

    /**
     * @return the status
     */
    public java.lang.Integer getStatus() {
        return status;
    }

    /**
     * @param status the status to set
     */
    public void setStatus(java.lang.Integer status) {
        this.status = status;
    }

    /**
     * @return the idxStatus
     */
    public java.lang.Integer getIdxStatus() {
        return idxStatus;
    }

    /**
     * @param idxStatus the idxStatus to set
     */
    public void setIdxStatus(java.lang.Integer idxStatus) {
        this.idxStatus = idxStatus;
    }

    /**
     * @return the createTime
     */
    public java.lang.Long getCreateTime() {
        return createTime;
    }

    /**
     * @param createTime the createTime to set
     */
    public void setCreateTime(java.lang.Long createTime) {
        this.createTime = createTime;
    }


    //
    // Chain
    //

    public static WechatMessageBuilder builder() {
        return new WechatMessageBuilder();
    }

    public WechatMessageBuilder bind() {
        return new WechatMessageBuilder(this);
    }

    public static class WechatMessageBuilder {

        private WechatMessage _model;

        public WechatMessageBuilder() {
            _model = new WechatMessage();
        }

        public WechatMessageBuilder(WechatMessage model) {
            _model = model;
        }

        public WechatMessage build() {
            return _model;
        }


        public IConnectionHolder connectionHolder() {
            return _model.getConnectionHolder();
        }

        public WechatMessageBuilder connectionHolder(IConnectionHolder connectionHolder) {
            _model.setConnectionHolder(connectionHolder);
            return this;
        }

        public String dataSourceName() {
            return _model.getDataSourceName();
        }

        public WechatMessageBuilder dataSourceName(String dsName) {
            _model.setDataSourceName(dsName);
            return this;
        }

        public IShardingable shardingable() {
            return _model.getShardingable();
        }

        public WechatMessageBuilder shardingable(IShardingable shardingable) {
            _model.setShardingable(shardingable);
            return this;
        }

        public java.lang.String id() {
            return _model.getId();
        }

        public WechatMessageBuilder id(java.lang.String id) {
            _model.setId(id);
            return this;
        }

        public java.lang.String fromUid() {
            return _model.getFromUid();
        }

        public WechatMessageBuilder fromUid(java.lang.String fromUid) {
            _model.setFromUid(fromUid);
            return this;
        }

        public java.lang.String toUid() {
            return _model.getToUid();
        }

        public WechatMessageBuilder toUid(java.lang.String toUid) {
            _model.setToUid(toUid);
            return this;
        }

        public java.lang.String content() {
            return _model.getContent();
        }

        public WechatMessageBuilder content(java.lang.String content) {
            _model.setContent(content);
            return this;
        }

        public java.lang.Integer isStar() {
            return _model.getIsStar();
        }

        public WechatMessageBuilder isStar(java.lang.Integer isStar) {
            _model.setIsStar(isStar);
            return this;
        }

        public java.lang.Integer isReplied() {
            return _model.getIsReplied();
        }

        public WechatMessageBuilder isReplied(java.lang.Integer isReplied) {
            _model.setIsReplied(isReplied);
            return this;
        }

        public java.lang.Integer isAutoreply() {
            return _model.getIsAutoreply();
        }

        public WechatMessageBuilder isAutoreply(java.lang.Integer isAutoreply) {
            _model.setIsAutoreply(isAutoreply);
            return this;
        }

        public java.lang.Integer isRead() {
            return _model.getIsRead();
        }

        public WechatMessageBuilder isRead(java.lang.Integer isRead) {
            _model.setIsRead(isRead);
            return this;
        }

        public java.lang.Integer isDeleted() {
            return _model.getIsDeleted();
        }

        public WechatMessageBuilder isDeleted(java.lang.Integer isDeleted) {
            _model.setIsDeleted(isDeleted);
            return this;
        }

        public java.lang.String sessionFlag() {
            return _model.getSessionFlag();
        }

        public WechatMessageBuilder sessionFlag(java.lang.String sessionFlag) {
            _model.setSessionFlag(sessionFlag);
            return this;
        }

        public java.lang.Integer type() {
            return _model.getType();
        }

        public WechatMessageBuilder type(java.lang.Integer type) {
            _model.setType(type);
            return this;
        }

        public java.lang.Integer status() {
            return _model.getStatus();
        }

        public WechatMessageBuilder status(java.lang.Integer status) {
            _model.setStatus(status);
            return this;
        }

        public java.lang.Integer idxStatus() {
            return _model.getIdxStatus();
        }

        public WechatMessageBuilder idxStatus(java.lang.Integer idxStatus) {
            _model.setIdxStatus(idxStatus);
            return this;
        }

        public java.lang.Long createTime() {
            return _model.getCreateTime();
        }

        public WechatMessageBuilder createTime(java.lang.Long createTime) {
            _model.setCreateTime(createTime);
            return this;
        }

    }

    /**
     * WechatMessage 字段常量表
     */
    public class FIELDS {
        public static final String ID = "id";
        public static final String FROM_UID = "from_uid";
        public static final String TO_UID = "to_uid";
        public static final String CONTENT = "content";
        public static final String IS_STAR = "is_star";
        public static final String IS_REPLIED = "is_replied";
        public static final String IS_AUTOREPLY = "is_autoreply";
        public static final String IS_READ = "is_read";
        public static final String IS_DELETED = "is_deleted";
        public static final String SESSION_FLAG = "session_flag";
        public static final String TYPE = "type";
        public static final String STATUS = "status";
        public static final String IDX_STATUS = "idx_status";
        public static final String CREATE_TIME = "create_time";
    }

    public static final String TABLE_NAME = "wechat_message";

}
